package com.springbatch.springbatch.dbtodb;

import com.springbatch.springbatch.bo.Person;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

public class PersonRowMapper implements RowMapper<Person> {

    @Override
    public Person mapRow(ResultSet rs, int rowNum) throws SQLException {
        //"ID,lastName,firstName,position,birthYear, debutYear"
        Person person = new Person();
        person.setId(rs.getString(1));
        person.setFirstName(rs.getString(2));
        person.setLastName(rs.getString(3));
        return person;
    }
}
